package com.zhiliao.common.db;

import com.zhiliao.common.db.impl.M;

/**
 * Description:数据库建表
 *
 * @author Jin
 * @create 2017-04-18
 **/
public interface DbTableAssistant<T> {

    /**
     * create
     * @return
     */
    T create();

    /**
     * edit
     * @return
     */
    T edit();

    /**
     * delete
     * @return
     */
    T delete();

    /**
     * BuilderSQL
     * @return
     */
    String builderSQL();

    /**
     * TableName
     * @param tableName
     * @return
     */
    T tableName(String tableName);

    /**
     * InitColumn
     * @param columnName
     * @param columnType
     * @param length
     * @param autoIncrement
     * @param defaultValue
     * @param isNotNull
     * @param isPrimaryKey
     * @return
     */
    T initColumn(String columnName, M columnType, Integer length, boolean autoIncrement, String defaultValue, boolean isNotNull,boolean isPrimaryKey);

    /**
     * AddColumn
     * @param columnName
     * @param columnType
     * @param length
     * @param autoIncrement
     * @param defaultValue
     * @param isNotNull
     * @param isPrimaryKey
     * @return
     */
    T addColumn(String columnName,M columnType,Integer length, boolean autoIncrement,String defaultValue,boolean isNotNull,boolean isPrimaryKey);

    /**
     * ChangeColumn
     * @param columnName
     * @param newColumnNane
     * @param columnType
     * @param length
     * @param autoIncrement
     * @param defaultValue
     * @param isNotNull
     * @return
     */
    T changeColumn(String columnName,String newColumnNane,M columnType,Integer length,boolean autoIncrement,String defaultValue,boolean isNotNull);

    /**
     * DropColumn
     * @param columnName
     * @param isPrimaryKey
     * @return
     */
    T dropColumn(String columnName,boolean isPrimaryKey);

    /**
     * AddIndex
     * @param cloumnName
     * @param length
     * @return
     */
    T addIndex(String cloumnName,Integer length);

    /**
     * Engine
     * @param engineName
     * @return
     */
    T engine(String engineName);

    /**
     * CharSet
     * @param charset
     * @return
     */
    T charSet(String charset);

}
